/**
 * 直播试看页
 * page试看
 */
import 'package:flutter/material.dart';

import 'package:qgchat/common/global/global.dart';

class TryToSee extends StatefulWidget {
  TryToSee({Key key}) : super(key: key);

  @override
  _TryToSeeState createState() => _TryToSeeState();
}

class _TryToSeeState extends State<TryToSee> with AutomaticKeepAliveClientMixin {
  @override
  bool get wantKeepAlive => true;
  
  Widget anchor = Container(
    width: px(334),
    height: px(800),
    child: Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        ClipRRect(
          borderRadius: BorderRadius.circular(px(10)),
          child: Stack(
            children: <Widget>[
              Image.network(
                "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2978782906,723865607&fm=26&gp=0.jpg",
                width: px(334),
                height: px(334),
                fit: BoxFit.cover,
              ),
              Positioned(
                top: px(15),
                right: px(15),
                child: Container(
                  height: px(30),
                  padding: EdgeInsets.symmetric(horizontal: px(6)),
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(px(4)),
                    gradient: LinearGradient(colors: [
                      col("2becdd"),
                      col("24d4f2"),
                      col("5a93fe"),
                    ]),
                  ),
                  child: Text(
                    "试看1分钟",
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: px(20),
                    ),
                  ),
                ),
              ),
              Positioned(
                bottom: px(15),
                left: px(15),
                child: Container(
                  child: Row(
                    children: <Widget>[
                      Container(
                        margin: EdgeInsets.only(right: px(7)),
                        child: Image.asset(
                          "assets/images/icon/money.png",
                          width: px(26),
                          height: px(26),
                        ),
                      ),
                      Text(
                        "23金币/分钟",
                        style: TextStyle(
                          color: Colors.white,
                          fontSize: px(24),
                        ),
                      )
                    ],
                  ),
                ),
              )
            ],
          ),
        ),
        Container(
          margin: EdgeInsets.only(top: px(25)),
          child: Text(
            "避风堰了望塔上的",
            overflow: TextOverflow.ellipsis,
            style: TextStyle(
              color: col("303133"),
              fontSize: px(30),
            ),
          ),
        ),
        Container(
          margin: EdgeInsets.only(top: px(15)),
          child: Text(
            "Isabella",
            overflow: TextOverflow.ellipsis,
            style: TextStyle(
              color: col("909399"),
              fontSize: px(24),
            ),
          ),
        ),
      ],
    ),
  );

  @override
  Widget build(BuildContext context) {
    super.build(context);
    return GridView(
      padding: EdgeInsets.all(px(30)),
      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
        crossAxisCount: 2,
        mainAxisSpacing: px(36),
        crossAxisSpacing: px(22),
        childAspectRatio:67/90
      ),
      children: <Widget>[
        anchor,
        anchor,
        anchor,
        anchor,
        anchor,
        anchor,
        anchor,
        anchor,
        anchor,
        anchor,
        anchor,
        anchor,
      ],
    );
  }
}
